package com.mangaenglish.business.controller;

import com.google.common.collect.Lists;
import com.mangaenglish.common.dto.response.ChapterDTO;
import com.mangaenglish.common.dto.response.PageDTO;
import com.mangaenglish.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018/1/7 0007.
 */
@Api("章节接口")
@RestController
public class ChapterController {

    @ApiOperation("章节详情")
    @RequestMapping(value = "/chapters/{chapter_id}", method = RequestMethod.GET)
    public Result<ChapterDTO> chapterContent(@PathVariable("chapter_id") String chapterId){
        List pages = Lists.newArrayList();
        pages.add(PageDTO.builder().pageId("1").pageNum(1).href("www.baidu.com/1").build());
        pages.add(PageDTO.builder().pageId("2").pageNum(2).href("www.baidu.com/2").build());
        pages.add(PageDTO.builder().pageId("3").pageNum(3).href("www.baidu.com/3").build());
        return Result.createSucess(ChapterDTO.builder().categoryId("doreamon_chatper_1").categoryName("哆唻A梦_第一章").pages(pages).build());

    }

}
